import request from '@/utils/request'

// 查询贯标认证列表
export function listGbrz(query) {
  return request({
    url: '/gbrz/gbrz/list',
    method: 'get',
    params: query
  })
}

// 查询贯标认证详细
export function getGbrz(gbrzId) {
  return request({
    url: '/gbrz/gbrz/' + gbrzId,
    method: 'get'
  })
}

// 新增贯标认证
export function addGbrz(data) {
  return request({
    url: '/gbrz/gbrz',
    method: 'post',
    data: data
  })
}

// 修改贯标认证
export function updateGbrz(data) {
  return request({
    url: '/gbrz/gbrz',
    method: 'put',
    data: data
  })
}

// 删除贯标认证
export function delGbrz(gbrzId) {
  return request({
    url: '/gbrz/gbrz/' + gbrzId,
    method: 'delete'
  })
}

// 获得贯标认证主键ID
export function getGbRzId() {
  return request({
    url: '/gbrz/gbrz/getGbRzId',
    method: 'get'
  })
}

// 新增附件
export function insertGbrzFjByGbrzId(data) {
  return request({
    url: '/gbrz/gbrz/add/File/By/subId',
    method: 'post',
    data: data
  })
}

// 根据主表ID查询附件列表
export function selectGbrzFjList(gbrzId) {
  return request({
    url: '/gbrz/gbrz/get/FileList/By/subId?sId=' + gbrzId,
    method: 'get'
  })
}

// 删除贯标认证附件
export function deleteGbrzFjByFjIds(fjId) {
  return request({
    url: '/gbrz/gbrz/fj/' + fjId,
    method: 'delete'
  })
}
